﻿@namespace MudBlazor
@inherits MudComponentBase
@typeparam T

<MudToolBar @attributes="UserAttributes" Class="@Classname" Style="@Style">
    <div class="mud-table-pagination-spacer"></div>
    @if (!DisableRowsPerPage)
    {
        <MudText Typo="Typo.body2" Class="mud-table-pagination-caption">
            @RowsPerPageString
        </MudText>
        <MudSelect T="string" ValueChanged="@SetRowsPerPageAsync" Value="@DataGrid?.RowsPerPage.ToString()" Class="mud-table-pagination-select" DisableUnderLine="true" Dense="true">
            @foreach (int pageSize in PageSizeOptions)
            {
                <MudSelectItem T="string" Value="@pageSize.ToString()">@pageSize.ToString().ToUpper()</MudSelectItem>
            }
        </MudSelect>
    }
    <MudText Typo="Typo.body2" Class="mud-table-pagination-caption">
        @Info
    </MudText>
    <div class="mud-table-pagination-actions">
        <MudIconButton Class="mud-flip-x-rtl" Icon="@Icons.Material.Filled.FirstPage" Disabled="@BackButtonsDisabled" @onclick="@(() => DataGrid.NavigateTo(Page.First))"/>
        <MudIconButton Class="mud-flip-x-rtl" Icon="@Icons.Material.Filled.NavigateBefore" Disabled="@BackButtonsDisabled" @onclick="@(() => DataGrid.NavigateTo(Page.Previous))"/>
        <MudIconButton Class="mud-flip-x-rtl" Icon="@Icons.Material.Filled.NavigateNext" Disabled="@ForwardButtonsDisabled" @onclick="@(() => DataGrid.NavigateTo(Page.Next))"/>
        <MudIconButton Class="mud-flip-x-rtl" Icon="@Icons.Material.Filled.LastPage" Disabled="@ForwardButtonsDisabled" @onclick="@(() => DataGrid.NavigateTo(Page.Last))"/>
    </div>
</MudToolBar>

